import Vue from "vue";
import VueRouter from "vue-router";
import Home from "@/views/home/Home";

const Category = () => import("@/views/category/Category");
const Cart = () => import("@/views/cart/Cart");
const Profile = () => import("@/views/profile/Profile");
const Detail = () => import("@/views/detail/Detail");

Vue.use(VueRouter);
const routes = [
  {
    path: "",
    redirect: "/home",
  },
  {
    path: "/home",
    name: "Home",
    component: Home,
  },
  {
    path: "/category",
    name: "Category",
    component: Category,
  },
  {
    path: "/cart",
    name: "Cart",
    component: Cart,
  },
  {
    path: "/profile",
    name: "Profile",
    component: Profile,
  },
  // {
  //   path: "/detail/:id",
  //   name: "Detail",
  //   component: Detail,
  // },
  {
    path: "/detail",
    name: "Detail",
    component: Detail,
  },
];
const router = new VueRouter({
  routes,
});
export default router;
